//
//  PCDApiOpenSafariWeb.m
//  PCDBankSix
//
//  Created by Jason Tao on 2022/4/26.
//

#import "PCDApiOpenSafariWeb.h"

@implementation PCDApiOpenSafariWeb

- (void)handler:(id)data andContext:(PCDContext *)context ResponseCallback:(WVJBResponseCallback )responseCallback
{
    NSString * strUrl = [data objectForKey:@"url"];
    if (![PCDUtil nilOrEmptyString:strUrl]) {
        NSURL * url = [NSURL URLWithString:strUrl];
        if([[UIApplication sharedApplication] canOpenURL:url]) {
            if (@available(iOS 10.0, *)) {
                [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
                    
                }];
            } else {
                [[UIApplication sharedApplication] openURL:url];
            }
        }
    }
    
}

@end
